package net.towee.client.com.lobby.view;

import net.towee.client.com.stuff.view.GroupsFinderView;
import net.towee.client.i18n.ToweeConstants;
import net.towee.client.resources.ClientResource;
import net.towee.client.widgets.ExtFlowPanel;

import com.google.gwt.user.client.ui.FlowPanel;
import com.google.inject.Inject;

public class LobbyGroupsFinderView extends GroupsFinderView {
	
	@Inject
	public LobbyGroupsFinderView(ToweeConstants constants, ClientResource resource) {
		super(constants, resource);
	}

	/**
	 * Left column
	 */
	protected void createLeftColumn() {
		super.createLeftColumn();
		
		// Create about text
		createTextAndButtonsContainer();
	}

	/**
	 * Build area with text information
	 */
	private void createTextAndButtonsContainer() {
		// Create header and text
		ExtFlowPanel header = new ExtFlowPanel(constants.lobbyGroupsInHeader(), true);
		ExtFlowPanel text = new ExtFlowPanel(constants.lobbyGroupsInText(), true);

		header.setStyleName(resource.css().h2());
		text.setStyleName(resource.css().normalText());

		FlowPanel textContainer = new FlowPanel();
		textContainer.setStyleName(resource.css().lobbyGroupInTextContainer());
		textContainer.getElement().getStyle().setProperty("margin", "0 25px 0 25px");
		textContainer.add(header);
		textContainer.add(text);
		rightColumn.add(textContainer);
	}
}